<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo1"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<body>

<div class="layui-card">

    <div class="layui-card-header">
        <span class="layui-icon font-s10 color-desc margin-right-5"></span>佣金管理
        <div class="pull-right">
<!--            <button data-table-id="NoticeTable" class="layui-btn layui-btn-primary  layui-btn-sm" data-modal="/system/user/form" data-height="720px" data-width="800px">-->
<!--                <i class=" layui-icon layui-icon-addition"></i>新建护工</button>-->
        </div>
    </div>

    <div class="layui-card-line"></div>

    <div class="layui-card-body">

        <div class="layui-card-table layui-tab">
            <div class="layui-tab-content">
                <form th:replace="/pcs/order_commission/index_search">

                </form>
                <table id="OrderCommissionTable"  th:attr="data-url=${'/pcs/order_commission/index'}" data-target-search="form.form-search"></table>
                <script th:inline="javascript">
                    var porterName = [[${porterName}]]
                    var orderStatus = [[${orderStatus}]]
                </script>
                <script type="text/javascript" th:inline="none">
                    $(function () {
                        $('#OrderCommissionTable').layTable({
                            even: true, height: 'full',where:{porterName:porterName,orderStatus:orderStatus},
                            cols: [[
                                {title: '序号', type: 'numbers', width: 80},
                                {field: 'type', title: '订单类型', minWidth: 100, align: 'center',templet: function (d) {
                                        let str = ""
                                        switch (d.type){
                                            case 1:
                                                str = "陪护";
                                                break;
                                            case 2:
                                                str = "陪诊";
                                                break;
                                            case 3:
                                                str = "陪检";
                                                break;
                                        }
                                        return str;

                                    }},
                                {field: 'sn', title: '订单编号', minWidth: 220, align: 'center'},
                                {field: 'patientName', title: '患者姓名', minWidth: 100, align: 'center'},
                                {field: 'depName', title: '病区', minWidth: 90, align: 'center'},
                                {field: 'bedNo', title: '床位', minWidth: 60, align: 'center'},
                                {field: 'projectTitle', title: '项目名称', minWidth: 180, align: 'center'},
                                {field: 'porterName', title: '陪护员', minWidth: 90, align: 'center'},
                                {field: 'total', title: '总费用', minWidth: 90, align: 'center'},
                                {field: 'commission', title: '佣金', minWidth: 90, align: 'center'},
                                {field: 'endTime', title: '订单结束时间', minWidth: 150, align: 'center'},
                                {toolbar: '#toolbar', title: '操作', align: 'center',minWidth: 150,  fixed: 'right'}
                            ]]
                        });
                    });



                </script>



                <script type="text/html" id="toolbar">
                    <a class="layui-btn layui-btn-sm" data-event-dbclick data-title="查看明细"   shiro:hasPermission="pcs:OrderCommission:index" data-width="1400px"   data-modal='/pcs/order_commission/detail?id={{d.id}}'>查看明细</a></script>

            </div>
        </div>
    </div>

</div>
</body>
</html>